<div class="slide-dialog-header">
	<h2>{{title}}</h2>
	<div class="slide-dialog-toolbar">
		<ul>
			<li><span class="ui-btn slide-dialog-close" ng-click="close(false)"><i class="fa fa-remove"></i></span></li>
		</ul>
	</div>
</div>
<div class="slide-dialog-body x-slide-dialog-body">
	<div class="x-data-panel-fixed">
		<form name="form" novalidate="novalidate" ng-submit="submit(form.$valid);">
			<div class="x-data-panel-body">
				<div class="data-form">
					<table cellspacing="0" cellpadding="0">
						<colgroup>
							<col width="100" />
						</colgroup>
						<tbody>
							<tr>
								<td>类型：</td>
								<td>
									<label class="radio-group" ng-init="data.type=data.type||fields.types[0].id" ng-repeat="type in fields.types track by type.id"><input type="radio" ng-model="data.type" name="type" class="x-radio" value="{{type.id}}" ng-disabled="data.id" />{{type.name}}</label>
								</td>
							</tr>
							<tr>
								<td class="x-control"><span class="x-star">*</span>字典表名：</td>
								<td>
									<input type="text" name="field" ng-model="data.field" class="x-ipt" ng-pattern="/^[a-zA-Z_]+$/" placeholder="请输入字典表名" 
									remote="{name: 'dictionary_checkIsExist', params: {id: data.id}}" required ng-disabled="data.id" />
									<div class="x-error" ng-if="interacted(form.field)" ng-messages="form.field.$error">
		                                <span ng-message="required">字典表名不能为空</span>
		                                <span ng-message="pattern">字典表名只能为字母、下划线组合</span>
		                                <span ng-message="remote">字典表名已存在</span>
		                            </div>
								</td>
							</tr>
							<tr>
								<td class="x-control"><span class="x-star">*</span>显示名称：</td>
								<td>
									<input type="text" name="fieldName" ng-model="data.fieldName" class="x-ipt" placeholder="请输入显示名称" required />
									<div class="x-error" ng-if="interacted(form.fieldName)" ng-messages="form.fieldName.$error">
		                                <span ng-message="required">显示名称不能为空</span>
		                            </div>
								</td>
							</tr>
							<tr>
								<td class="x-control"><span class="x-star">*</span>枚举值：</td>
								<td>
									<div class="data-map">
										<dl ng-repeat="key in jsonKeys() track by $index">
											<dt><input type="text" class="x-ipt" ng-model="json[key]" placeholder="请输入键名" required ng-disabled="data.id && data.type==1 && !_temp[key]" /></dt>
											<dd>
												<input type="text" class="x-ipt" ng-model="json[getJsonValue(key)]" placeholder="请输入键值" required />
												<span class="data-map-tools">
													<span class="ico-btn fa fa-minus-square" ng-if="!(data.id && data.type==1 && !_temp[key])" ng-click="removeJson(key)"></span>
													<span class="ico-btn fa fa-plus-square" ng-if="$index == jsonKeys().length - 1" ng-click="addJson()"></span>
												</span>
											</dd>
										</dl>
									</div>
								</td>
							</tr>
							<!-- <tr>
								<td class="x-control"><span class="x-star">*</span>枚举值：</td>
								<td>
									<div class="data-options">
										<div class="data-option" ng-repeat="option in data.options track by $index"><span class="text-danger">键</span>：{{option.name}}<span ng-if="option.value">&nbsp;&nbsp;<span class="text-danger">值</span>：{{option.value}}</span><i class="fa fa-minus-circle" ng-click="removeOption($index)"></i></div><div class="data-option-add" ng-click="addOption($event)" data-placement="left">+</div>
									</div>
								</td>
							</tr> -->
							<tr>
								<td class="x-control">描述：</td>
								<td><textarea ng-model="data.desc" rows="8" class="x-ipt" placeholder="请输入"></textarea></td>
							</tr>
						</tbody>
					</table>
					<!-- <dl>
						<dt><span class="x-star">*</span>字段名称：</dt>
						<dd>
							<input type="text" name="name" ng-model="data.name" class="x-ipt" ng-pattern="/^a-zA-Z_$/" placeholder="请输入字段名称" required />
							<div class="x-error" ng-if="interacted(form.name)" ng-messages="form.name.$error">
                                <span ng-message="required">字段名称不能为空</span>
                            </div>
						</dd>
					</dl>
					<dl>
						<dt><span class="x-star">*</span>枚举值：</dt>
						<dd>
							<div class="data-options">
								<div class="data-option" ng-repeat="option in data.options track by $index"><span class="text-danger">键</span>：{{option.name}}<span ng-if="option.value">&nbsp;&nbsp;<span class="text-danger">值</span>：{{option.value}}</span><i class="fa fa-minus-circle" ng-click="removeOption($index)"></i></div><div class="data-option-add" ng-click="addOption($event)" data-placement="left">+</div>
							</div>
						</dd>
					</dl>
					<dl>
						<dt>描述：</dt>
						<dd><textarea ng-model="data.desc" rows="12" class="x-ipt" placeholder="请输入"></textarea></dd>
					</dl> -->
				</div>
			</div>
			<div class="x-data-panel-footer">
				<button class="dialog-button cancel-button" type="button" ng-click="close(false)">取消</button><button class="dialog-button" type="submit" ng-disabled="formDisabled">提交</button>
			</div>
		</form>
	</div>
</div>